package com.framework.auth.api.feign;

import com.framework.auth.api.feign.factory.RemoteAuthFallbackFactory;
import com.framework.common.config.feign.FeignConfig;
import com.framework.common.constant.ServiceNameConstants;
import com.framework.common.request.CustomInfoReq;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

import java.security.Principal;

/**
 * @author zhoubb
 * @version V1.0
 * @Date 2020/5/8 21:07
 * @since JDK 1.8
 */
@FeignClient(name = ServiceNameConstants.SERVICE_AUTH,
        configuration={FeignConfig.class},
        fallbackFactory = RemoteAuthFallbackFactory.class)
public interface RemoteAuthService {

    @RequestMapping(value = "current/get",method = RequestMethod.GET)
    public Principal user(Principal principal);

    @RequestMapping(value = "user/refreshTtzAuthentication",method = RequestMethod.POST)
    public void refreshTtzAuthentication(CustomInfoReq customInfoReq);

}
